package com.MusicWeb.servlet;

import com.MusicWeb.service.TipService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/tipdel")
//todo : 用户删除短消息  传入用户id 音乐id
//http://localhost:8080/tipdel?uid=
public class TipDelServlet extends HttpServlet {
    TipService tipService = new TipService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer id = Integer.parseInt(req.getParameter("uid"));
        if (tipService.Tipdel(id) != -1) {
            req.getSession().setAttribute("msg", "删除消息成功");
        } else {
            req.getSession().setAttribute("msg", "删除消息失败");
        }

    }
}
